<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>ADB命令 | 移动端测试课程介绍</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-splitter/splitter.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-chapter-fold/chapter-fold.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../day1/app_tools.html" />
    
    
    <link rel="prev" href="../day1/create_env/geny.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="1.3"
        data-chapter-title="ADB命令"
        data-filepath="day1/command_adb.md"
        data-basepath=".."
        data-revision="Sat Jun 08 2019 07:44:25 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="day1/readme.html">
            
                
                    <a href="../day1/readme.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        移动入门
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="day1/app_test_knowledge.html">
            
                
                    <a href="../day1/app_test_knowledge.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        移动端测试概述
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="day1/create_env/readme.html">
            
                
                    <a href="../day1/create_env/readme.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        移动测试环境搭建搭建
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="day1/create_env/java.html">
            
                
                    <a href="../day1/create_env/java.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.1.</b>
                        
                        Java环境搭建
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="day1/create_env/sdk.html">
            
                
                    <a href="../day1/create_env/sdk.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.2.</b>
                        
                        Android sdk 环境
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="day1/create_env/geny.html">
            
                
                    <a href="../day1/create_env/geny.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.3.</b>
                        
                        Android 虚拟机安装
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="1.3" data-path="day1/command_adb.html">
            
                
                    <a href="../day1/command_adb.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        ADB命令
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="day1/app_tools.html">
            
                
                    <a href="../day1/app_tools.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        移动端自动化工具
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="day1/appium_env.html">
            
                
                    <a href="../day1/appium_env.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        appium环境搭建
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="day1/start_appium.html">
            
                
                    <a href="../day1/start_appium.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        appium入门案例
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="day2/readme.html">
            
                
                    <a href="../day2/readme.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        app操作api
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="day2/base_api.html">
            
                
                    <a href="../day2/base_api.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        app基础操作api
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="day2/uiauto.html">
            
                
                    <a href="../day2/uiauto.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        uiautomatorviewer工具
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="day2/location_element.html">
            
                
                    <a href="../day2/location_element.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        app元素定位操作api
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="day2/get_infor.html">
            
                
                    <a href="../day2/get_infor.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        根据元素获取信息api
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="day2/element_event.html">
            
                
                    <a href="../day2/element_event.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        元素事件操作
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="day2/touch_action.html">
            
                
                    <a href="../day2/touch_action.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        模拟手势操作
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="day2/phone_api.html">
            
                
                    <a href="../day2/phone_api.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        手机操作api
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="day3/readme.html">
            
                
                    <a href="../day3/readme.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        Pytest
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="day3/install_introduction.html">
            
                
                    <a href="../day3/install_introduction.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        pytest安装和介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="day3/setup_teardown.html">
            
                
                    <a href="../day3/setup_teardown.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        setup和teardown函数
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="day3/pytest_config.html">
            
                
                    <a href="../day3/pytest_config.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        pytest的配置文件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="day3/middle.html">
            
                
                    <a href="../day3/middle.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        pytest常用插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="day3/pytest_prov1.html">
            
                
                    <a href="../day3/pytest_prov1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        pytest提高1--fixture
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="day3/pytest_prov2.html">
            
                
                    <a href="../day3/pytest_prov2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        pytest提高2
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="day4/readme.html">
            
                
                    <a href="../day4/readme.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        PO模式
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="day4/introduction.html">
            
                
                    <a href="../day4/introduction.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        PO模式介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="day4/project_plan.html">
            
                
                    <a href="../day4/project_plan.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        项目准备
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="day4/logic.html">
            
                
                    <a href="../day4/logic.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        按照业务抽取代码
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="day4/find_element.html">
            
                
                    <a href="../day4/find_element.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        抽取的find_element
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="day4/base_action.html">
            
                
                    <a href="../day4/base_action.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        抽取基础动作
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="day5/readme.html">
            
                
                    <a href="../day5/readme.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        数据驱动--Yaml
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="day5/introduction_yaml.html">
            
                
                    <a href="../day5/introduction_yaml.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        Yaml介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="day5/pyyaml.html">
            
                
                    <a href="../day5/pyyaml.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        python解析yaml文件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="day5/yaml_data.html">
            
                
                    <a href="../day5/yaml_data.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        yaml数据驱动案例
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="day6/readme.html">
            
                
                    <a href="../day6/readme.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        Allure报告和Jenkins集成
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="day6/allure.html">
            
                
                    <a href="../day6/allure.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        allure介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="day6/pytest_allure.html">
            
                
                    <a href="../day6/pytest_allure.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        pytest中使用allure
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="day6/jenkins.html">
            
                
                    <a href="../day6/jenkins.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.</b>
                        
                        Jenkins安装
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="day6/jenkins_git_allure_email.html">
            
                
                    <a href="../day6/jenkins_git_allure_email.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.4.</b>
                        
                        Jenkins持续集成配置
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >移动端测试课程介绍</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="adb&#x5E38;&#x7528;&#x547D;&#x4EE4;">ADB&#x5E38;&#x7528;&#x547D;&#x4EE4;</h1>
<h2 id="&#x5B66;&#x4E60;&#x76EE;&#x6807;">&#x5B66;&#x4E60;&#x76EE;&#x6807;</h2>
<ul>
<li>&#x638C;&#x63E1;&#x5E38;&#x7528;&#x7684;ADB&#x547D;&#x4EE4;</li>
</ul>
<h3 id="1-adb&#x547D;&#x4EE4;&#x7B80;&#x4ECB;">1. ADB&#x547D;&#x4EE4;&#x7B80;&#x4ECB;</h3>
<pre><code>ADB&#x5168;&#x540D;Andorid Debug Bridge&#x3002; &#x662F;&#x4E00;&#x4E2A;Debug&#x5DE5;&#x5177;&#x3002;&#x4E3A;&#x4F55;&#x79F0;&#x4E4B;&#x4E3A;Bridge&#x5462;? 
&#x56E0;&#x4E3A;adb&#x662F;&#x4E00;&#x4E2A;&#x6807;&#x51C6;&#x7684;C/S&#x7ED3;&#x6784;&#x7684;&#x5DE5;&#x5177;, &#x662F;&#x8981;&#x8FDE;&#x63A5;&#x5F00;&#x53D1;&#x7535;&#x8111;&#x548C;&#x8C03;&#x8BD5;&#x624B;&#x673A;&#x7684;

&#x5305;&#x542B;&#x5982;&#x4E0B;&#x51E0;&#x4E2A;&#x90E8;&#x5206;:
    1.Client&#x7AEF;&#xFF0C;&#x8FD0;&#x884C;&#x5728;&#x5F00;&#x53D1;&#x673A;&#x5668;&#x4E2D;&#xFF0C;&#x5373;&#x4F60;&#x7684;&#x5F00;&#x53D1;PC&#x673A;&#x3002;&#x7528;&#x6765;&#x53D1;&#x9001;adb&#x547D;&#x4EE4;&#x3002;
    2.Daemon&#x5B88;&#x62A4;&#x8FDB;&#x7A0B;, &#x8FD0;&#x884C;&#x5728;&#x8C03;&#x8BD5;&#x8BBE;&#x5907;&#x4E2D;, &#x5373;&#x7684;&#x8C03;&#x8BD5;&#x624B;&#x673A;&#x6216;&#x6A21;&#x62DF;&#x5668;&#x3002;
    3.Server&#x7AEF;, &#x4F5C;&#x4E3A;&#x4E00;&#x4E2A;&#x540E;&#x53F0;&#x8FDB;&#x7A0B;&#x8FD0;&#x884C;&#x5728;&#x5F00;&#x53D1;&#x673A;&#x5668;&#x4E2D;, &#x5373;&#x4F60;&#x7684;&#x5F00;&#x53D1;PC&#x673A;. &#x7528;&#x6765;&#x7BA1;&#x7406;PC&#x4E2D;&#x7684;Client&#x7AEF;&#x548C;&#x624B;&#x673A;&#x7684;Daemon&#x4E4B;&#x95F4;&#x7684;&#x901A;&#x4FE1;&#x3002;
</code></pre><h3 id="2-&#x5E38;&#x7528;&#x547D;&#x4EE4;">2. &#x5E38;&#x7528;&#x547D;&#x4EE4;</h3>
<ul>
<li>adb &#x5E2E;&#x52A9;</li>
</ul>
<pre><code>adb --help
</code></pre><ul>
<li>&#x542F;&#x52A8;adb &#x670D;&#x52A1;</li>
</ul>
<pre><code>adb start-server
</code></pre><ul>
<li>&#x5173;&#x95ED;adb &#x670D;&#x52A1;</li>
</ul>
<pre><code>adb kill-server
</code></pre><ul>
<li>&#x83B7;&#x53D6;&#x8BBE;&#x5907;&#x53F7;</li>
</ul>
<pre><code>adb devices
</code></pre><ul>
<li>&#x83B7;&#x53D6;&#x7CFB;&#x7EDF;&#x7248;&#x672C;</li>
</ul>
<pre><code>adb shell getprop ro.build.version.release
</code></pre><ul>
<li>&#x53D1;&#x9001;&#x6587;&#x4EF6;&#x5230;&#x624B;&#x673A;</li>
</ul>
<pre><code>adb push &#x7535;&#x8111;&#x7AEF;&#x2F42;&#x4EF6;&#x8DEF;&#x5F84;/&#x9700;&#x8981;&#x53D1;&#x9001;&#x7684;&#x6587;&#x4EF6;,&#x624B;&#x673A;&#x7AEF;&#x5B58;&#x50A8;&#x7684;&#x8DEF;&#x5F84;

adb push C:\Users\win\Desktop\xx.png /sdcard
</code></pre><ul>
<li>&#x4ECE;&#x624B;&#x673A;&#x62C9;&#x53D6;&#x6587;&#x4EF6;</li>
</ul>
<pre><code>adb pull &#x624B;&#x673A;&#x7AEF;&#x7684;&#x8DEF;&#x5F84;/&#x62C9;&#x53D6;&#x6587;&#x4EF6;&#x540D; &#x7535;&#x8111;&#x7AEF;&#x5B58;&#x50A8;&#x6587;&#x4EF6;&#x8DEF;&#x5F84;

adb pull /sdcard/xx.png C:\Users\win\Desktop
</code></pre><ul>
<li>&#x67E5;&#x770B;&#x624B;&#x673A;&#x8FD0;&#x884C;&#x65E5;&#x5FD7;</li>
</ul>
<pre><code>adb logcat
</code></pre><ul>
<li>&#x8FDB;&#x5165;&#x5230;&#x624B;&#x673A;&#x7EC8;&#x7AEF;</li>
</ul>
<pre><code>adb shell
</code></pre><ul>
<li>&#x83B7;&#x53D6;app&#x542F;&#x52A8;&#x5305;&#x540D;&#x548C;&#x542F;&#x52A8;&#x540D;(&#x26A0;&#x624B;&#x673A;&#x9700;&#x8981;&#x5148;&#x6253;&#x5F00;&#x5BF9;&#x5E94;app)</li>
</ul>
<pre><code>1.Mac/Linux: &apos;adb shell dumpsys window windows | grep mFocusedApp&#x2019;
2.&#x5728; Windows &#x7EC8;&#x7AEF;&#x8FD0;&#x2F8F; &apos;adb shell dumpsys window windows | findstr mFocusedApp&#x2019;
</code></pre><ul>
<li>&#x5B89;&#x88C5;app&#x5230;&#x624B;&#x673A;</li>
</ul>
<pre><code>adb install &#x8DEF;&#x5F84;/xxx.apk
</code></pre><ul>
<li>&#x5378;&#x8F7D;&#x624B;&#x673A;app</li>
</ul>
<pre><code>adb uninstall app
</code></pre><ul>
<li>&#x83B7;&#x53D6;app&#x542F;&#x52A8;&#x65F6;&#x95F4;</li>
</ul>
<pre><code>adb shell am start -W &#x5305;&#x540D;/.&#x542F;&#x52A8;&#x540D;
</code></pre>
                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../day1/create_env/geny.html" class="navigation navigation-prev " aria-label="Previous page: Android 虚拟机安装"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../day1/app_tools.html" class="navigation navigation-next " aria-label="Next page: 移动端自动化工具"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-splitter/splitter.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"expandable-chapters-small":{},"splitter":{},"chapter-fold":{},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
